<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.Map,java.util.Date,java.text.SimpleDateFormat;"%>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c"%>
<div class="toolbar">
	<c:if test="${userinfo.ui_username eq 'admin' or model.r_create eq 1}">
		<button
			href="<%=request.getContextPath()%>/c?${ model.m_action }&m_id=${model.m_id }&o=form&p=add"
			class="btn btn-large btn-success add">
			<i class="icon-plus"></i> <span>新建</span>
		</button>
	</c:if>
	<c:if test="${userinfo.ui_username eq 'admin' or model.r_update eq 1}">
		<button class="btn btn-large btn-primary edit"
			href="<%=request.getContextPath()%>/c?${ model.m_action }&o=form&p=edit&m_id=${model.m_id }&pri=${pri }&v=${model.m_view}&key=">
			<i class="icon-pencil"></i> <span>编辑</span>
		</button>
	</c:if>
	<c:if test="${userinfo.ui_username eq 'admin' or model.r_delete eq 1}">
		<button class="btn btn-large btn-danger" id="btn-delete"
			href="<%=request.getContextPath()%>/c?s=ajax&o=delete&view=${model.m_view }&pri=${pri}&id=">
			<i class="icon-remove"></i> <span>删除</span>
		</button>
	</c:if>
</div>

<table cellpadding="0" cellspacing="0" border="0" class="dataTable cell-border" id="yf-datatable"
m_id="${model.m_id }" view="${ model.m_view}" pri="${pri}"
datasource="<%=request.getContextPath()%>/c?s=ajax&o=rows&m_id=${model.m_id }&pri=${pri}&cols=${cols}">
	<thead>
		<tr>
			<c:forEach var="control" items="${controls }">
				<c:if test="${control.mc_show ==1}">
					<c:if test="${control.mc_auto ==0}">
						<th col="${control.mc_attr_name }" tag="${control.c_tag }" dft_val="${control.mc_dft_val }" ds='${control.mc_ds }'>${control.mc_prompt}</th>
					</c:if>
				</c:if>
			</c:forEach>
		</tr>
	</thead>
	<tbody>
	</tbody>
</table>

<script>
var $table = $("#yf-datatable").dt({'fileurl':'<%=request.getContextPath()%>'});
</script>